home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d15 / maximo_1.arc / TXT.ARC / UDRIVE.TXT < prev    next >
Text File  |  1991-08-20  |  15KB  |  677 lines

  1. ;
  2. ;  UDRIVE  -- test drive module
  3. ;        (c) 1990 Chris Butler
  4. ;
  5.  
  6. ; cbuf 2 is effectively a global buffer
  7.  
  8.   set all off
  9.   goto top
  10. all:
  11.   set all on
  12. top:  
  13.  
  14. video g
  15. color 3
  16. clearscr
  17. color 15
  18. rect 50 25 590 325
  19. color 0
  20. fload ibm16
  21. rect 65 326 600 336
  22. rect 591 40 602 336
  23. text 90,290 "Dear Demo Disk Viewer,"
  24. text 90,250 "Welcome to the MAXIMO Series 3 Test Drive!"
  25. text 90,220 "The Test Drive is a MAXIMO simulation that guides you through"
  26. text 90,205 "the Inventory scenario in the `Solutions' section of this disk."
  27. text 90,180 "The two minute Test Drive will demonstrate the clear, graphic"
  28. text 90,165 "presentation format and natural simplicity of our user interface."
  29. text 90,150 "You'll also experience the power and responsiveness of our"
  30. text 90,135 "database as it answers complex questions with ease."
  31. text 90,105 "Please press `Enter' to begin the Test Drive."
  32. text 90,75 "Sincerely,"
  33. text 90,45  "PSDI"
  34. waitkey 100
  35. note 100 10 10
  36. waitkey
  37. color 15
  38. clearscr
  39. setpage 0 1 
  40. pload bigpic2 1
  41. color 15
  42. clearscr
  43. palette 1
  44. setupscr 1
  45. ;pfade 0 1
  46. pfree 1
  47. cload 911color.clp 1 1 0
  48. cfade 20 96,10 1
  49. waitkey 100
  50. pan 0 0 90 0  2
  51. pan 90 0 700 0 60
  52. waitkey 20
  53. global    boxllx 0 ; mod 8 = 0
  54. global    boxlly 0
  55. global    boxw  488
  56. global    boxh  115
  57. global    boxtitle "    Test Drive Module"
  58.  
  59. set h 17    ; key height
  60. set keycolor 11 ; keytop color in convbox = 11 (yellow)
  61. set txtboxclr 14; cyan
  62. local xoff1 13    ; offset into instr box for text panel
  63. local yoff1 65    ; see xoff
  64. local yoff2 49
  65. local yoff3 33
  66. local yoff4 17
  67. color 15
  68. clearscr
  69. resetscr
  70. pfree 1
  71. setpage
  72. video m
  73. color 15
  74. clearscr
  75.  
  76. set entrypoint "entry_13"     ; return to MASTER
  77. label905:
  78. newbgrnd "u2a.pcx" 80 40 1 1 150 9
  79. dotext udrv1
  80.  
  81. cload u2percnt.clp 10 0 0
  82. cload u2b.clp 11 0 0
  83. cload u2e.clp 12 0 0
  84. cload u2a.clp 13 0 0
  85. cload u2r.clp 14 0 0
  86. cload u2i.clp 15 0 0
  87. cload u2n.clp 16 0 0
  88. cload u2g.clp 17 0 0
  89.  
  90. label906:
  91. getcharcmd
  92. if @0==backup label906
  93. if @0=="%" label907
  94. beep
  95. goto label906
  96. label907:
  97. putup 179,415 10
  98. getcharcmd
  99. if @0==b label908
  100. if @0=="B" label908
  101. beep
  102. goto label907
  103. label908:
  104. putup 189,415 11
  105. getcharcmd
  106. if @0==e label909
  107. if @0=="E" label909
  108. beep
  109. goto label908
  110. label909:
  111. putup 199,415 12
  112. waitkey
  113. ifkey a label910 "A" label910
  114. getcharcmd
  115. if @0==a label910
  116. if @0=="A" label910
  117. beep goto label909
  118. label910:
  119. putup 207,415 13
  120. getcharcmd
  121. if @0==r label911
  122. if @0=="R" label911
  123. beep
  124. goto label910
  125. label911:
  126. putup 216,415 14
  127. getcharcmd
  128. if @0==i label912
  129. if @0=="I" label912
  130. beep
  131. goto label911
  132. label912:
  133. putup 226,415 15
  134. getcharcmd
  135. if @0==n label913
  136. if @0=="N" label913
  137. beep
  138. goto label912
  139. label913:
  140. putup 230,415 16
  141. getcharcmd
  142. if @0==g label914
  143. if @0=="G" label914
  144. beep
  145. goto label913
  146. label914:
  147. putup 240,415 17
  148. getcharcmd
  149. if @0=="%" label915
  150. beep
  151. goto label914
  152. label915:
  153. putup 251,415 10
  154. getcharcmd
  155. if @0==altn label917
  156. beep
  157. goto label915
  158. label917:
  159. cfree 10 11 12 13 14 15 16 17
  160.  
  161. label920:
  162. putup 0,0 2    ; restore under instr box
  163. newbgrnd "u3.pcx" 80 40 1 1 50 9
  164. dotext udrv2
  165. cload shilite.clp 1 0 0 ; hilited "Screens" for fcn bar
  166. label921:
  167. getcharcmd 
  168. if @0==alts label925
  169. if @0==backup label905
  170. ifkey "ALT-S" label925
  171. beep
  172. goto label921
  173.  
  174. label925:
  175. putup 0,0 2    ; restore
  176. waitkey 25
  177. putup 0,0 1 ; first hilite "Screens"
  178. newbgrnd "18.pcx" 80 40 1 1 100 9
  179. dotext udrv3
  180. cload swu 10 1 0 ; hilite Where Used bar vers. of Screens menu
  181. label926:
  182. getcharcmd
  183. if @0==altw label935
  184. beep
  185. goto label926
  186.  
  187. label935:
  188. putup 0,0 2    ; restore
  189. waitkey 25
  190. putup 400,289 10 ; hilite Where Used
  191. cfree 10
  192. newbgrnd "19.pcx" 80 0 1 1 200 9 ; Where Used screen
  193. dotext udrv4
  194. label936:
  195. getcharcmd
  196. if @0==alts label940
  197. beep
  198. goto label936
  199.  
  200. label940:
  201. putup 0,0 2    ; restore
  202. waitkey 25
  203. putup 0,0 1    ; hilite Screens on fcn bar
  204. newbgrnd "19s.pcx" 80 40 1 1 100 9  ; dropdown submenu
  205. dotext udrv5
  206. cload 19alta.clp 10 1 0   ; preload hilited Alt Parts submenu
  207. label941:
  208. getcharcmd
  209. if @0==alta label945
  210. beep
  211. goto label941
  212.  
  213. label945:
  214. putup 0,0 2    ; restore
  215. waitkey 25
  216. putup 400,246 10 ; hilite Alt Parts 
  217. cfree 10
  218. newbgrnd "20.pcx" 80 40 1 1 200 9    ; Alt Parts scr
  219. dotext udrv6
  220. label946:
  221. getcharcmd
  222. if @0==alts label950
  223. beep
  224. goto label946
  225.  
  226.  
  227. label950:
  228. putup 0,0 2
  229. waitkey 25
  230. putup 0,0 1    ; hilite Screens
  231. newbgrnd "20s.pcx" 80 40 1 1 100 9  ; drop submenu
  232. dotext udrv7
  233. cload 20altp.clp 10 1 0   
  234. label951:
  235. getcharcmd
  236. if @0==altp label955
  237. beep
  238. goto label951
  239.  
  240.  
  241. label955:
  242. putup 0,0 2
  243. waitkey 25
  244. putup 400,245 10
  245. cfree 10
  246. newbgrnd "u4.pcx" 80 40 1 1 10 9
  247. dotext udrv8
  248. waitkey
  249.  
  250. cfree  2 ; original under box 
  251. video g
  252. color 15
  253. clearscr
  254. setpage 0 1
  255. pload bigpic2 1
  256. clearscr
  257. palette 1
  258. setupscr 1
  259. pfree 1
  260. cload 911color.clp 1 1 0
  261. cfade 20 384,0 1
  262. cload trailer.clp 1 1 0
  263. cfade 1 920,0 1
  264. cfree 1
  265. pan 0 0  640 0 5
  266. note 100 10 10
  267. waitkey 500
  268. rect 0    0 640 179
  269. pan 640 0 1279 0 5
  270. color 15
  271. clearscr
  272. resetscr
  273. setpage
  274. video m
  275. if @all==on
  276.   link roi.txt    all
  277.  else
  278.   LINK MASTER.TXT entry_13
  279.  endif
  280. ----------------------------------------------------------
  281. ;
  282. ; GETCHARCMD -- process input to conversation box
  283. ;
  284. ;        uses cbuf 5 for temp 
  285. getcharcmd:
  286. local bndryoff (@boxllx+417)%8 ; boundary offset
  287. local flashon "1"           ; flash toggle
  288.  
  289. cmdloop:
  290. waitkey; 15 nokeyyet
  291. ifkey h cmdh m cmdm s cmds left cmdb "?" cmdh  "H" cmdh "S" cmds ESC cmdm
  292. ifkey "ALT-S" doalts "ALT-A" doalta "ALT-N" doaltn "ALT-P" doaltp "ALT-W" doaltw
  293.  
  294. getkey thechar    ; not a cmd char: return it to caller
  295. return @thechar  ;  
  296.  
  297. gotbttn:
  298.  
  299. doalta:
  300.   return "alta"
  301. doaltn:
  302.   return "altn"
  303. doaltp:
  304.   return "altp"
  305. doalts:
  306.   return "alts"  
  307. doaltw:
  308.   return  "altw"
  309.  
  310. cmdb: 
  311.   set bttnx @boxllx+"4"  ; backup button
  312.   set w "62"
  313. ; putup @bndryoff,0 5 ; make sure keytop lettering in place            
  314.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; "95"=y offset height for button
  315.   return "backup"
  316. cmdc: 
  317.   set bttnx @boxllx+414 ; continue button
  318.   set w "70"
  319.  ;putup @bndryoff,0 5 ; make sure keytop lettering in place            
  320.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  321.   return "continue"
  322. cmdh: 
  323.   set bttnx @boxllx+"119" ; help button
  324.   set w "47"
  325. ; putup @bndryoff,0 5 ; make sure keytop lettering in place
  326.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  327.   gosub instrhelp
  328.   goto cmdloop
  329. cmdm: 
  330.   set bttnx @boxllx+"66"    ; menu button
  331.   set w "53"
  332. ;  putup @bndryoff,0 5 ; make sure keytop lettering in place            
  333.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  334.   gosub menu_cmd
  335.   goto cmdloop
  336. cmds: 
  337.   set bttnx @boxllx+"350"  ; screen button
  338.   set w "64"
  339. ; putup @bndryoff,0 5 ; make sure keytop lettering in place            
  340.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  341.   screen
  342.   color @keycolor
  343.   goto cmdloop
  344.  
  345. done: 
  346. return    ; subr GETCHARCMD 
  347.  
  348. ; ------------------------------------------
  349. ;
  350. ;  SCREEN -- temporarily remove CONVBOX from screen
  351. ;
  352. ;        uses cbuf 3,4
  353.  
  354. screen:
  355. cfree 3           ; dump blank convbox
  356. cgetbuf 3 @boxllx,@boxlly @boxllx+@boxw,@boxlly+117 1 0 ; save current convbox
  357. putup 0,0 2          ; restore original convbox
  358. color 0,15
  359. box @boxllx,@boxlly @boxllx+@boxw,@boxlly+115 2 ; outline box to replace convbox
  360. fload russell
  361. fstyle 6 2 2 
  362. text @boxllx+100,@boxlly+50 "type R to Restore"
  363. cgetbuf 4 @boxllx,@boxlly @boxllx+@boxw,@boxlly+119 1 0 ;save orig w/restore msg
  364. waitkey 50
  365.  
  366. littloop:
  367. putup 0,0 2
  368. ifmouse 1 littlp4,,,,,, 20 littlp1
  369. littlp1:
  370. waitkey 20 littlp2
  371. ifkey r littlp4 "R" littlp4 ; want r/R to "restore"
  372. noise 100,1000 30
  373. goto littlp2
  374. littlp2:
  375. putup 0,0 4
  376. ifmouse 1 littlp4,,,,,, 20 littlp3
  377. littlp3:
  378. waitkey 20 littloop
  379. ifkey r littlp4 "R" littlp4 ; want r/R to "restore"
  380. noise 100,1000 30
  381. goto littloop
  382. littlp4:
  383.  
  384. putup 0,0 3    ; replace original
  385. fload ibm16    ; restore orig font
  386. fstyle 0    ; turn off shadowing
  387. return        ; subr SCREEN
  388.  
  389. ; --------------------------------------------
  390.  
  391. ;  INSTRHELP -- putup help for instruction box
  392. ;         temp uses cbuf 3 and cbuf 9
  393. ;         called from GETCMD    
  394.  
  395. instrhelp:
  396. convhelp:
  397. local sidemarg 3
  398. local bottmarg 2
  399. local rim 5
  400. local picdim 80
  401.  
  402. local fotollx @boxllx+@rim+@sidemarg
  403. local fotolly @boxlly+@rim+@bottmarg+1
  404. local fotourx @boxllx+@boxw-(@sidemarg+@rim+1)
  405. local fotoury @boxlly+@rim+@bottmarg+@picdim+2
  406. local flashon 0
  407.  
  408. cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0;
  409. local txtoff (@fotollx)%8 ; boundary offset of clipping
  410. local contoff (@boxllx+417)%8 ; boundary offset of clipping
  411.  
  412. color @txtboxclr
  413. rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt
  414. cload instrhlp 9 1 0          ; help panel
  415. putup @fotollx+16,@fotolly+1 9     
  416. color @keycolor
  417. waitkey
  418. cfree  9
  419.  
  420.  
  421. putup @txtoff,0 3          ; restore original convbox
  422. cfree 3
  423. return        ; subr INSTRHELP formerly CONVHELP
  424. ; -----------------------------------------
  425. ;  MENU_CMD -- LINK BACK TO MAIN MENU IN MASTER
  426. ;
  427. ;        uses cbuf 3 (temp)
  428. ;
  429. menu_cmd:
  430. local sidemarg 3
  431. local bottmarg 2
  432. local rim 5
  433. local picdim 80
  434.  
  435. local fotollx @boxllx+@rim+@sidemarg
  436. local fotolly @boxlly+@rim+@bottmarg+1
  437. local fotourx @boxllx+@boxw-(@sidemarg+@rim+1)
  438. local fotoury @boxlly+@rim+@bottmarg+@picdim+2
  439. local flashon 0
  440.  
  441. cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0;
  442. local txtoff (@fotollx)%8 ; boundary offset of clipping
  443. local contoff (@boxllx+417)%8 ; boundary offset of clipping
  444.  
  445. color @txtboxclr
  446. rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt
  447. cload menuwarn 1 1 0        ; help panel
  448. putup @fotollx+16,@fotolly+1 1     
  449. color @keycolor
  450. waitkey
  451. ifkey "M" menu_out m menu_out
  452.   putup @txtoff,0 3          ; restore original convbox
  453.   return
  454. menu_out:
  455.   link master.txt @entrypoint
  456.  
  457. ; END SUBR MENU_CMD
  458. -----------------------
  459. ;
  460. ;  PUSHBUTTON -- actuate onscreen "button"
  461. ;            uses MS Windows button format (white #15 top line and
  462. ;            2 bars of gray #8 shading)
  463. ;
  464. ;        temporarily uses cbuf 8
  465. ;
  466. pushbutton:
  467. local llx @1    ; lower left corner of button x
  468. local lly @2    ; lower left corner          y
  469. local h @3    ; height
  470. local w @4    ; width
  471. local keycolor @5 ; color of keytop 
  472.         ; note: uses buffer 1 
  473.  
  474. local bndryoff (@llx+2)%8 ; boundary offset (@llx+2=x start of clipping)
  475. set wait "0"  ; diagnostic switch
  476.  
  477. cgetbuf 8 @llx+2,@lly+3 @llx+@w-3,@lly+@h-2 0 0; grab cntr of buttn 
  478. color @keycolor 
  479. if @wait
  480.   waitkey 
  481. endif
  482. line @llx+1,@lly+1 @llx+1,@lly+@h-1 ; gray out left white line
  483. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 ; gray out top white line
  484.  
  485. putup 1+@bndryoff,-1 8
  486. color @keycolor
  487.  
  488. point @llx+2,@lly+2 
  489. point @llx+@w-2,@lly+@h-2
  490. if @wait
  491.   waitkey 
  492. endif
  493.  
  494. putup 2+@bndryoff,-2 8
  495. point @llx+2,@lly+1 
  496. point @llx+3,@lly+1
  497. point @llx+@w-1,@lly+@h-2
  498. point @llx+@w-1,@lly+@h-3
  499. color 8
  500. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  501. color 0
  502. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  503. if @wait
  504.   waitkey 
  505. endif
  506.  
  507. putup 1+@bndryoff,-1 8
  508. color 7
  509. line @llx+2,@lly+1 @llx+@w-1,@lly+1
  510. line @llx+@w-1,@lly+1 @llx+@w-1,@lly+@h-2
  511. color @keycolor
  512. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  513. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  514. if @wait
  515.   waitkey 
  516. endif
  517.  
  518.  
  519. cgetbuf 8 @llx+3,@lly+1 @llx+@w-1,@lly+@h-3 0 0 ;
  520. putup @bndryoff,1 8  ; new clipping from lr corner
  521. color 15
  522. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  523. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  524. color 7
  525. point @llx+1,@lly+1        ; ll corner
  526. point @llx+@w-1,@lly+@h-1    ; tr corner
  527. if @wait
  528.   waitkey 
  529. endif
  530.  
  531. cfree 8
  532. return ; subr PUSHBUTTON
  533.  
  534. ;
  535. ;  SAY -- put speech into the conversation box
  536. ;        @1 speaker (1=max,0=other)    
  537. ;        @2 first text string
  538. ;        @3 second text string
  539. ;
  540.  
  541. say:
  542. fload ibm16
  543. color @txtboxclr
  544. rect @boxllx+94,@boxlly+9 @boxllx+394,@boxlly+89
  545. window @boxllx+100,@boxlly+13 @boxllx+390,@boxlly+87
  546. waitkey 50
  547. color 0
  548. text @2 3
  549. text @3 3
  550. window
  551. return      ; subr SAY
  552.  
  553. ;
  554. ;  NEWBGRND  -- installs new bgrnd and convbox
  555. ;        @1 = new pic name
  556. ;        @2 = new conv box llx (must be byte boundary)
  557. ;        @3 = new conv box lly
  558. ;        @4 = 1 => maxtalk (hilite max's box)
  559. ;        @5 = 1 => install new palette
  560. ;        @6 = delay between pic and convbox
  561. ;        @7 = pic fade to use 
  562. ;        **   puts orig under convbox in buffer 2
  563.  
  564. newbgrnd:
  565. set boxllx @2
  566. set boxlly @3
  567. pload @1 1
  568. if @5
  569.  palette 1
  570. endif
  571.  
  572. pfade @7 1
  573. pfree 1
  574.  
  575. ; N.B. this code is duplicated in JUSTABOX
  576.  
  577. cgetbuf 2 @boxllx,@boxlly @boxllx+@boxw,@boxlly+@boxh 1 0 ; save orig to buff 2
  578. cload smbox3.clp 3 1 0      ; blank convbox to buffer 3
  579. waitkey @6            ; delay before conv box
  580. putup @boxllx,@boxlly 3     ; putup conv box
  581. cfree 3
  582.  
  583. return    ; subr NEWBGRND
  584. ;---------------------------------------------
  585. beep:
  586. note 200 20 10
  587. note 400 20 10
  588. return; SUBR BEEP
  589. ;----------------------------------------------
  590. ;
  591. ;  JUSTABOX -- only put an instruction box
  592. ;    @1 = boxllx
  593. ;    @2 = boxlly
  594. ;    cbuf2 := orig under box 
  595. ;    cbuf3     used temporarily
  596. ;
  597.  
  598. justabox:
  599. set boxllx @1
  600. set boxlly @2
  601. cgetbuf 2 @1,@2 @1+@boxw,@2+@boxh 1 0 ; save orig to buff 2
  602. cload smbox3.clp 3 1 0      ; blank convbox to buffer 3
  603. waitkey @6            ; delay before conv box
  604. putup @1,@2 3    ; putup conv box
  605. cfree 3
  606.  
  607. return ; SUBR JUSTABOX
  608. -----------------------------------------------
  609. ;
  610. ; DOTEXT -- write text into instruction box
  611. ;
  612. ; @1 = data block with four strings         
  613. ;
  614. dotext:
  615. color 0
  616. databegin @1
  617. text @boxllx+@xoff1,@boxlly+@yoff1 @
  618. text @boxllx+@xoff1,@boxlly+@yoff2 @
  619. text @boxllx+@xoff1,@boxlly+@yoff3 @
  620. text @boxllx+@xoff1,@boxlly+@yoff4 @
  621. return; SUBR DOTEXT
  622. ----------------------------------------------------
  623. ;
  624. ;  DATA BLOCKS FOR TEST DRIVE
  625. ;
  626. udrv1:
  627. "First we want to find out how many bearings we have on hand."
  628. "We don't know the Part Number so we'll search through all"
  629. "bearings to find the one we want. Type %BEARING% then type"
  630. "ALT-N to get the Next (actually the first) bearing record."
  631. dataend
  632. udrv2:
  633. "The first record is the block bearing we're looking for. But"
  634. "we're out (Current Balance = 0). Maybe we can cannibalize"
  635. "non-critical equipment to get our rebuild parts. First, type"
  636. "ALT-S to drop down the Screens menu."
  637. dataend
  638. udrv3:
  639. "  "
  640. "Good. Now type ALT-W to select the Where Used screen."
  641. "  "
  642. "  "
  643. datend
  644. udrv4:
  645. " The Where Used screen shows all uses of the bearing. Alas,"
  646. " all of this equipment is vital production machinery so"
  647. " none is a candidate for cannibalization. Let's look for a "
  648. " substitute instead. Type ALT-S to drop the Screens menu."
  649. dataend:
  650. udrv5:
  651. "  "
  652. "OK, now type ALT-A to bring up the Alternate Parts screen."
  653. "  "
  654. "  "
  655. dataend
  656. udrv6:
  657. "The Alternate Parts screen suggests the 217215A bearing. To"
  658. "determine where 217215A bearings are stored and how many we"
  659. "have we'll use the Part Locations screen. First type ALT-S"
  660. "to drop down the Screens menu."
  661. datend
  662. udrv7:
  663. "  "
  664. "And then type ALT-P to bring up the Part Locations screen."
  665. "  "
  666. "  "
  667. dataend
  668. udrv8:
  669. "And the Parts Locations screen shows that you have one in"
  670. "your desk!"
  671. "  "
  672. "This concludes the Test Drive. Please press <Enter>."
  673. datend
  674. ; END OF UDRIVE INSTRUCTION TEXT DATA BLOCKS
  675. -------------------------------------------------------
  676.